import os

Import("env")

if env['build_guichan']:
    os.chdir("guichan")
    os.system("cmake .")
    os.system("cmake -DCMAKE_INSTALL_PREFIX:PATH=\"../../install\"")
    os.system("make install")

env.Install(env['GUICHAN_LIB_DIR'],
	    Glob('#/install/lib/libguichan_x*'))

env.Install(env['GUICHAN_INC_DIR'],
	    Glob('#/install/include/guichan.hpp'))
env.Install(env['GUICHAN_INC_DIR']+"/guichan",
	    Glob('#/install/include/guichan/*.hpp'))
env.Install(env['GUICHAN_INC_DIR']+"/guichan/widgets",
	    Glob('#/install/include/guichan/widgets/*.hpp'))
